/**
 * Created by charlie on 17-12-27.
 */
import React from 'react'
import UI from '../components/taiZhangDetail'
import {connect} from 'dva-no-router'
import {bindActionCreators} from 'redux'

class TaiZhangDetail extends React.Component{
    componentWillMount(){
        const {getTaiZhangDetail}=this.props;
        getTaiZhangDetail();
    }
    // componentDidMount() {
    //     const {getTaiZhangDetail}=this.props;
    //     getTaiZhangDetail();
    // }
    componentWillUnmount(){
        const {getClean}=this.props;
        getClean();
    }
    render(){
        return(
            <UI {...this.props}/>
        )
    }
}

const actions ={
    getTaiZhangDetail:() =>({type:'taiZhangDetail/getTaiZhangDetail'}),
    getClean:() =>({type:'taiZhangDetail/getClean'}),
    thisPhotoClose:() =>({type:'taiZhangDetail/thisPhotoClose'}),
    thisPhotoOpen:(val) =>({type:'taiZhangDetail/thisPhotoOpen',payload:val}),
};

const mapProps =({taiZhangDetail}) =>({taiZhangDetail});
const mapActions =dispatch =>({
    ...bindActionCreators({...actions},dispatch)
});
export default connect (mapProps,mapActions)(TaiZhangDetail)